Left Termination of the query pattern p_in_1(g) w.r.t. the given Prolog program could successfully be proven:



Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof

Clauses:

p(.(X, [])).
p(.(s(s(X)), .(Y, Xs))) :- ','(p(.(X, .(Y, Xs))), p(.(s(s(s(s(Y)))), Xs))).
p(.(0, Xs)) :- p(Xs).

Queries:

p(g).

We use the technique of [30]. With regard to the inferred argument filtering the predicates were used in the following modes:
p_in: (b)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

p_in_g(.(X, [])) → p_out_g(.(X, []))
p_in_g(.(s(s(X)), .(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(.(X, .(Y, Xs))))
p_in_g(.(0, Xs)) → U3_g(Xs, p_in_g(Xs))
U3_g(Xs, p_out_g(Xs)) → p_out_g(.(0, Xs))
U1_g(X, Y, Xs, p_out_g(.(X, .(Y, Xs)))) → U2_g(X, Y, Xs, p_in_g(.(s(s(s(s(Y)))), Xs)))
U2_g(X, Y, Xs, p_out_g(.(s(s(s(s(Y)))), Xs))) → p_out_g(.(s(s(X)), .(Y, Xs)))

The argument filtering Pi contains the following mapping:
p_in_g(x1)  =  p_in_g(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
p_out_g(x1)  =  p_out_g
s(x1)  =  s(x1)
U1_g(x1, x2, x3, x4)  =  U1_g(x2, x3, x4)
0  =  0
U3_g(x1, x2)  =  U3_g(x2)
U2_g(x1, x2, x3, x4)  =  U2_g(x4)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof
  ↳ PrologToPiTRSProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

p_in_g(.(X, [])) → p_out_g(.(X, []))
p_in_g(.(s(s(X)), .(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(.(X, .(Y, Xs))))
p_in_g(.(0, Xs)) → U3_g(Xs, p_in_g(Xs))
U3_g(Xs, p_out_g(Xs)) → p_out_g(.(0, Xs))
U1_g(X, Y, Xs, p_out_g(.(X, .(Y, Xs)))) → U2_g(X, Y, Xs, p_in_g(.(s(s(s(s(Y)))), Xs)))
U2_g(X, Y, Xs, p_out_g(.(s(s(s(s(Y)))), Xs))) → p_out_g(.(s(s(X)), .(Y, Xs)))

The argument filtering Pi contains the following mapping:
p_in_g(x1)  =  p_in_g(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
p_out_g(x1)  =  p_out_g
s(x1)  =  s(x1)
U1_g(x1, x2, x3, x4)  =  U1_g(x2, x3, x4)
0  =  0
U3_g(x1, x2)  =  U3_g(x2)
U2_g(x1, x2, x3, x4)  =  U2_g(x4)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

P_IN_G(.(s(s(X)), .(Y, Xs))) → U1_G(X, Y, Xs, p_in_g(.(X, .(Y, Xs))))
P_IN_G(.(s(s(X)), .(Y, Xs))) → P_IN_G(.(X, .(Y, Xs)))
P_IN_G(.(0, Xs)) → U3_G(Xs, p_in_g(Xs))
P_IN_G(.(0, Xs)) → P_IN_G(Xs)
U1_G(X, Y, Xs, p_out_g(.(X, .(Y, Xs)))) → U2_G(X, Y, Xs, p_in_g(.(s(s(s(s(Y)))), Xs)))
U1_G(X, Y, Xs, p_out_g(.(X, .(Y, Xs)))) → P_IN_G(.(s(s(s(s(Y)))), Xs))

The TRS R consists of the following rules:

p_in_g(.(X, [])) → p_out_g(.(X, []))
p_in_g(.(s(s(X)), .(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(.(X, .(Y, Xs))))
p_in_g(.(0, Xs)) → U3_g(Xs, p_in_g(Xs))
U3_g(Xs, p_out_g(Xs)) → p_out_g(.(0, Xs))
U1_g(X, Y, Xs, p_out_g(.(X, .(Y, Xs)))) → U2_g(X, Y, Xs, p_in_g(.(s(s(s(s(Y)))), Xs)))
U2_g(X, Y, Xs, p_out_g(.(s(s(s(s(Y)))), Xs))) → p_out_g(.(s(s(X)), .(Y, Xs)))

The argument filtering Pi contains the following mapping:
p_in_g(x1)  =  p_in_g(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
p_out_g(x1)  =  p_out_g
s(x1)  =  s(x1)
U1_g(x1, x2, x3, x4)  =  U1_g(x2, x3, x4)
0  =  0
U3_g(x1, x2)  =  U3_g(x2)
U2_g(x1, x2, x3, x4)  =  U2_g(x4)
P_IN_G(x1)  =  P_IN_G(x1)
U1_G(x1, x2, x3, x4)  =  U1_G(x2, x3, x4)
U3_G(x1, x2)  =  U3_G(x2)
U2_G(x1, x2, x3, x4)  =  U2_G(x4)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

P_IN_G(.(s(s(X)), .(Y, Xs))) → U1_G(X, Y, Xs, p_in_g(.(X, .(Y, Xs))))
P_IN_G(.(s(s(X)), .(Y, Xs))) → P_IN_G(.(X, .(Y, Xs)))
P_IN_G(.(0, Xs)) → U3_G(Xs, p_in_g(Xs))
P_IN_G(.(0, Xs)) → P_IN_G(Xs)
U1_G(X, Y, Xs, p_out_g(.(X, .(Y, Xs)))) → U2_G(X, Y, Xs, p_in_g(.(s(s(s(s(Y)))), Xs)))
U1_G(X, Y, Xs, p_out_g(.(X, .(Y, Xs)))) → P_IN_G(.(s(s(s(s(Y)))), Xs))

The TRS R consists of the following rules:

p_in_g(.(X, [])) → p_out_g(.(X, []))
p_in_g(.(s(s(X)), .(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(.(X, .(Y, Xs))))
p_in_g(.(0, Xs)) → U3_g(Xs, p_in_g(Xs))
U3_g(Xs, p_out_g(Xs)) → p_out_g(.(0, Xs))
U1_g(X, Y, Xs, p_out_g(.(X, .(Y, Xs)))) → U2_g(X, Y, Xs, p_in_g(.(s(s(s(s(Y)))), Xs)))
U2_g(X, Y, Xs, p_out_g(.(s(s(s(s(Y)))), Xs))) → p_out_g(.(s(s(X)), .(Y, Xs)))

The argument filtering Pi contains the following mapping:
p_in_g(x1)  =  p_in_g(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
p_out_g(x1)  =  p_out_g
s(x1)  =  s(x1)
U1_g(x1, x2, x3, x4)  =  U1_g(x2, x3, x4)
0  =  0
U3_g(x1, x2)  =  U3_g(x2)
U2_g(x1, x2, x3, x4)  =  U2_g(x4)
P_IN_G(x1)  =  P_IN_G(x1)
U1_G(x1, x2, x3, x4)  =  U1_G(x2, x3, x4)
U3_G(x1, x2)  =  U3_G(x2)
U2_G(x1, x2, x3, x4)  =  U2_G(x4)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 1 SCC with 2 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
PiDP
              ↳ PiDPToQDPProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

P_IN_G(.(0, Xs)) → P_IN_G(Xs)
P_IN_G(.(s(s(X)), .(Y, Xs))) → P_IN_G(.(X, .(Y, Xs)))
P_IN_G(.(s(s(X)), .(Y, Xs))) → U1_G(X, Y, Xs, p_in_g(.(X, .(Y, Xs))))
U1_G(X, Y, Xs, p_out_g(.(X, .(Y, Xs)))) → P_IN_G(.(s(s(s(s(Y)))), Xs))

The TRS R consists of the following rules:

p_in_g(.(X, [])) → p_out_g(.(X, []))
p_in_g(.(s(s(X)), .(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(.(X, .(Y, Xs))))
p_in_g(.(0, Xs)) → U3_g(Xs, p_in_g(Xs))
U3_g(Xs, p_out_g(Xs)) → p_out_g(.(0, Xs))
U1_g(X, Y, Xs, p_out_g(.(X, .(Y, Xs)))) → U2_g(X, Y, Xs, p_in_g(.(s(s(s(s(Y)))), Xs)))
U2_g(X, Y, Xs, p_out_g(.(s(s(s(s(Y)))), Xs))) → p_out_g(.(s(s(X)), .(Y, Xs)))

The argument filtering Pi contains the following mapping:
p_in_g(x1)  =  p_in_g(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
p_out_g(x1)  =  p_out_g
s(x1)  =  s(x1)
U1_g(x1, x2, x3, x4)  =  U1_g(x2, x3, x4)
0  =  0
U3_g(x1, x2)  =  U3_g(x2)
U2_g(x1, x2, x3, x4)  =  U2_g(x4)
P_IN_G(x1)  =  P_IN_G(x1)
U1_G(x1, x2, x3, x4)  =  U1_G(x2, x3, x4)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ PiDP
              ↳ PiDPToQDPProof
QDP
                  ↳ QDPOrderProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

P_IN_G(.(s(s(X)), .(Y, Xs))) → P_IN_G(.(X, .(Y, Xs)))
P_IN_G(.(0, Xs)) → P_IN_G(Xs)
U1_G(Y, Xs, p_out_g) → P_IN_G(.(s(s(s(s(Y)))), Xs))
P_IN_G(.(s(s(X)), .(Y, Xs))) → U1_G(Y, Xs, p_in_g(.(X, .(Y, Xs))))

The TRS R consists of the following rules:

p_in_g(.(X, [])) → p_out_g
p_in_g(.(s(s(X)), .(Y, Xs))) → U1_g(Y, Xs, p_in_g(.(X, .(Y, Xs))))
p_in_g(.(0, Xs)) → U3_g(p_in_g(Xs))
U3_g(p_out_g) → p_out_g
U1_g(Y, Xs, p_out_g) → U2_g(p_in_g(.(s(s(s(s(Y)))), Xs)))
U2_g(p_out_g) → p_out_g

The set Q consists of the following terms:

p_in_g(x0)
U3_g(x0)
U1_g(x0, x1, x2)
U2_g(x0)

We have to consider all (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


P_IN_G(.(0, Xs)) → P_IN_G(Xs)
The remaining pairs can at least be oriented weakly.

P_IN_G(.(s(s(X)), .(Y, Xs))) → P_IN_G(.(X, .(Y, Xs)))
U1_G(Y, Xs, p_out_g) → P_IN_G(.(s(s(s(s(Y)))), Xs))
P_IN_G(.(s(s(X)), .(Y, Xs))) → U1_G(Y, Xs, p_in_g(.(X, .(Y, Xs))))
Used ordering: Polynomial interpretation [25]:

POL(.(x1, x2)) = x1 + x2   
POL(0) = 1   
POL(P_IN_G(x1)) = x1   
POL(U1_G(x1, x2, x3)) = x1 + x2   
POL(U1_g(x1, x2, x3)) = 0   
POL(U2_g(x1)) = 0   
POL(U3_g(x1)) = 0   
POL([]) = 0   
POL(p_in_g(x1)) = 0   
POL(p_out_g) = 0   
POL(s(x1)) = x1   

The following usable rules [17] were oriented: none



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ PiDP
              ↳ PiDPToQDPProof
                ↳ QDP
                  ↳ QDPOrderProof
QDP
                      ↳ QDPOrderProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

P_IN_G(.(s(s(X)), .(Y, Xs))) → P_IN_G(.(X, .(Y, Xs)))
U1_G(Y, Xs, p_out_g) → P_IN_G(.(s(s(s(s(Y)))), Xs))
P_IN_G(.(s(s(X)), .(Y, Xs))) → U1_G(Y, Xs, p_in_g(.(X, .(Y, Xs))))

The TRS R consists of the following rules:

p_in_g(.(X, [])) → p_out_g
p_in_g(.(s(s(X)), .(Y, Xs))) → U1_g(Y, Xs, p_in_g(.(X, .(Y, Xs))))
p_in_g(.(0, Xs)) → U3_g(p_in_g(Xs))
U3_g(p_out_g) → p_out_g
U1_g(Y, Xs, p_out_g) → U2_g(p_in_g(.(s(s(s(s(Y)))), Xs)))
U2_g(p_out_g) → p_out_g

The set Q consists of the following terms:

p_in_g(x0)
U3_g(x0)
U1_g(x0, x1, x2)
U2_g(x0)

We have to consider all (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


P_IN_G(.(s(s(X)), .(Y, Xs))) → U1_G(Y, Xs, p_in_g(.(X, .(Y, Xs))))
The remaining pairs can at least be oriented weakly.

P_IN_G(.(s(s(X)), .(Y, Xs))) → P_IN_G(.(X, .(Y, Xs)))
U1_G(Y, Xs, p_out_g) → P_IN_G(.(s(s(s(s(Y)))), Xs))
Used ordering: Polynomial interpretation [25]:

POL(.(x1, x2)) = 1 + x2   
POL(0) = 0   
POL(P_IN_G(x1)) = x1   
POL(U1_G(x1, x2, x3)) = 1 + x2   
POL(U1_g(x1, x2, x3)) = 0   
POL(U2_g(x1)) = 0   
POL(U3_g(x1)) = 0   
POL([]) = 0   
POL(p_in_g(x1)) = 0   
POL(p_out_g) = 0   
POL(s(x1)) = 0   

The following usable rules [17] were oriented: none



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ PiDP
              ↳ PiDPToQDPProof
                ↳ QDP
                  ↳ QDPOrderProof
                    ↳ QDP
                      ↳ QDPOrderProof
QDP
                          ↳ DependencyGraphProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

P_IN_G(.(s(s(X)), .(Y, Xs))) → P_IN_G(.(X, .(Y, Xs)))
U1_G(Y, Xs, p_out_g) → P_IN_G(.(s(s(s(s(Y)))), Xs))

The TRS R consists of the following rules:

p_in_g(.(X, [])) → p_out_g
p_in_g(.(s(s(X)), .(Y, Xs))) → U1_g(Y, Xs, p_in_g(.(X, .(Y, Xs))))
p_in_g(.(0, Xs)) → U3_g(p_in_g(Xs))
U3_g(p_out_g) → p_out_g
U1_g(Y, Xs, p_out_g) → U2_g(p_in_g(.(s(s(s(s(Y)))), Xs)))
U2_g(p_out_g) → p_out_g

The set Q consists of the following terms:

p_in_g(x0)
U3_g(x0)
U1_g(x0, x1, x2)
U2_g(x0)

We have to consider all (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ PiDP
              ↳ PiDPToQDPProof
                ↳ QDP
                  ↳ QDPOrderProof
                    ↳ QDP
                      ↳ QDPOrderProof
                        ↳ QDP
                          ↳ DependencyGraphProof
QDP
                              ↳ UsableRulesProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

P_IN_G(.(s(s(X)), .(Y, Xs))) → P_IN_G(.(X, .(Y, Xs)))

The TRS R consists of the following rules:

p_in_g(.(X, [])) → p_out_g
p_in_g(.(s(s(X)), .(Y, Xs))) → U1_g(Y, Xs, p_in_g(.(X, .(Y, Xs))))
p_in_g(.(0, Xs)) → U3_g(p_in_g(Xs))
U3_g(p_out_g) → p_out_g
U1_g(Y, Xs, p_out_g) → U2_g(p_in_g(.(s(s(s(s(Y)))), Xs)))
U2_g(p_out_g) → p_out_g

The set Q consists of the following terms:

p_in_g(x0)
U3_g(x0)
U1_g(x0, x1, x2)
U2_g(x0)

We have to consider all (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ PiDP
              ↳ PiDPToQDPProof
                ↳ QDP
                  ↳ QDPOrderProof
                    ↳ QDP
                      ↳ QDPOrderProof
                        ↳ QDP
                          ↳ DependencyGraphProof
                            ↳ QDP
                              ↳ UsableRulesProof
QDP
                                  ↳ QReductionProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

P_IN_G(.(s(s(X)), .(Y, Xs))) → P_IN_G(.(X, .(Y, Xs)))

R is empty.
The set Q consists of the following terms:

p_in_g(x0)
U3_g(x0)
U1_g(x0, x1, x2)
U2_g(x0)

We have to consider all (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

p_in_g(x0)
U3_g(x0)
U1_g(x0, x1, x2)
U2_g(x0)



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ PiDP
              ↳ PiDPToQDPProof
                ↳ QDP
                  ↳ QDPOrderProof
                    ↳ QDP
                      ↳ QDPOrderProof
                        ↳ QDP
                          ↳ DependencyGraphProof
                            ↳ QDP
                              ↳ UsableRulesProof
                                ↳ QDP
                                  ↳ QReductionProof
QDP
                                      ↳ UsableRulesReductionPairsProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

P_IN_G(.(s(s(X)), .(Y, Xs))) → P_IN_G(.(X, .(Y, Xs)))

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the usable rules with reduction pair processor [15] with a polynomial ordering [25], all dependency pairs and the corresponding usable rules [17] can be oriented non-strictly. All non-usable rules are removed, and those dependency pairs and usable rules that have been oriented strictly or contain non-usable symbols in their left-hand side are removed as well.

The following dependency pairs can be deleted:

P_IN_G(.(s(s(X)), .(Y, Xs))) → P_IN_G(.(X, .(Y, Xs)))
No rules are removed from R.

Used ordering: POLO with Polynomial interpretation [25]:

POL(.(x1, x2)) = 2·x1 + x2   
POL(P_IN_G(x1)) = 2·x1   
POL(s(x1)) = 2·x1   



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ PiDP
              ↳ PiDPToQDPProof
                ↳ QDP
                  ↳ QDPOrderProof
                    ↳ QDP
                      ↳ QDPOrderProof
                        ↳ QDP
                          ↳ DependencyGraphProof
                            ↳ QDP
                              ↳ UsableRulesProof
                                ↳ QDP
                                  ↳ QReductionProof
                                    ↳ QDP
                                      ↳ UsableRulesReductionPairsProof
QDP
                                          ↳ PisEmptyProof
  ↳ PrologToPiTRSProof

Q DP problem:
P is empty.
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
The TRS P is empty. Hence, there is no (P,Q,R) chain.
We use the technique of [30]. With regard to the inferred argument filtering the predicates were used in the following modes:
p_in: (b)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

p_in_g(.(X, [])) → p_out_g(.(X, []))
p_in_g(.(s(s(X)), .(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(.(X, .(Y, Xs))))
p_in_g(.(0, Xs)) → U3_g(Xs, p_in_g(Xs))
U3_g(Xs, p_out_g(Xs)) → p_out_g(.(0, Xs))
U1_g(X, Y, Xs, p_out_g(.(X, .(Y, Xs)))) → U2_g(X, Y, Xs, p_in_g(.(s(s(s(s(Y)))), Xs)))
U2_g(X, Y, Xs, p_out_g(.(s(s(s(s(Y)))), Xs))) → p_out_g(.(s(s(X)), .(Y, Xs)))

Pi is empty.

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

p_in_g(.(X, [])) → p_out_g(.(X, []))
p_in_g(.(s(s(X)), .(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(.(X, .(Y, Xs))))
p_in_g(.(0, Xs)) → U3_g(Xs, p_in_g(Xs))
U3_g(Xs, p_out_g(Xs)) → p_out_g(.(0, Xs))
U1_g(X, Y, Xs, p_out_g(.(X, .(Y, Xs)))) → U2_g(X, Y, Xs, p_in_g(.(s(s(s(s(Y)))), Xs)))
U2_g(X, Y, Xs, p_out_g(.(s(s(s(s(Y)))), Xs))) → p_out_g(.(s(s(X)), .(Y, Xs)))

Pi is empty.

Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

P_IN_G(.(s(s(X)), .(Y, Xs))) → U1_G(X, Y, Xs, p_in_g(.(X, .(Y, Xs))))
P_IN_G(.(s(s(X)), .(Y, Xs))) → P_IN_G(.(X, .(Y, Xs)))
P_IN_G(.(0, Xs)) → U3_G(Xs, p_in_g(Xs))
P_IN_G(.(0, Xs)) → P_IN_G(Xs)
U1_G(X, Y, Xs, p_out_g(.(X, .(Y, Xs)))) → U2_G(X, Y, Xs, p_in_g(.(s(s(s(s(Y)))), Xs)))
U1_G(X, Y, Xs, p_out_g(.(X, .(Y, Xs)))) → P_IN_G(.(s(s(s(s(Y)))), Xs))

The TRS R consists of the following rules:

p_in_g(.(X, [])) → p_out_g(.(X, []))
p_in_g(.(s(s(X)), .(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(.(X, .(Y, Xs))))
p_in_g(.(0, Xs)) → U3_g(Xs, p_in_g(Xs))
U3_g(Xs, p_out_g(Xs)) → p_out_g(.(0, Xs))
U1_g(X, Y, Xs, p_out_g(.(X, .(Y, Xs)))) → U2_g(X, Y, Xs, p_in_g(.(s(s(s(s(Y)))), Xs)))
U2_g(X, Y, Xs, p_out_g(.(s(s(s(s(Y)))), Xs))) → p_out_g(.(s(s(X)), .(Y, Xs)))

Pi is empty.
We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

P_IN_G(.(s(s(X)), .(Y, Xs))) → U1_G(X, Y, Xs, p_in_g(.(X, .(Y, Xs))))
P_IN_G(.(s(s(X)), .(Y, Xs))) → P_IN_G(.(X, .(Y, Xs)))
P_IN_G(.(0, Xs)) → U3_G(Xs, p_in_g(Xs))
P_IN_G(.(0, Xs)) → P_IN_G(Xs)
U1_G(X, Y, Xs, p_out_g(.(X, .(Y, Xs)))) → U2_G(X, Y, Xs, p_in_g(.(s(s(s(s(Y)))), Xs)))
U1_G(X, Y, Xs, p_out_g(.(X, .(Y, Xs)))) → P_IN_G(.(s(s(s(s(Y)))), Xs))

The TRS R consists of the following rules:

p_in_g(.(X, [])) → p_out_g(.(X, []))
p_in_g(.(s(s(X)), .(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(.(X, .(Y, Xs))))
p_in_g(.(0, Xs)) → U3_g(Xs, p_in_g(Xs))
U3_g(Xs, p_out_g(Xs)) → p_out_g(.(0, Xs))
U1_g(X, Y, Xs, p_out_g(.(X, .(Y, Xs)))) → U2_g(X, Y, Xs, p_in_g(.(s(s(s(s(Y)))), Xs)))
U2_g(X, Y, Xs, p_out_g(.(s(s(s(s(Y)))), Xs))) → p_out_g(.(s(s(X)), .(Y, Xs)))

Pi is empty.
We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 1 SCC with 2 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
PiDP
              ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

P_IN_G(.(0, Xs)) → P_IN_G(Xs)
P_IN_G(.(s(s(X)), .(Y, Xs))) → P_IN_G(.(X, .(Y, Xs)))
P_IN_G(.(s(s(X)), .(Y, Xs))) → U1_G(X, Y, Xs, p_in_g(.(X, .(Y, Xs))))
U1_G(X, Y, Xs, p_out_g(.(X, .(Y, Xs)))) → P_IN_G(.(s(s(s(s(Y)))), Xs))

The TRS R consists of the following rules:

p_in_g(.(X, [])) → p_out_g(.(X, []))
p_in_g(.(s(s(X)), .(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(.(X, .(Y, Xs))))
p_in_g(.(0, Xs)) → U3_g(Xs, p_in_g(Xs))
U3_g(Xs, p_out_g(Xs)) → p_out_g(.(0, Xs))
U1_g(X, Y, Xs, p_out_g(.(X, .(Y, Xs)))) → U2_g(X, Y, Xs, p_in_g(.(s(s(s(s(Y)))), Xs)))
U2_g(X, Y, Xs, p_out_g(.(s(s(s(s(Y)))), Xs))) → p_out_g(.(s(s(X)), .(Y, Xs)))

Pi is empty.
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ PiDP
              ↳ PiDPToQDPProof
QDP

Q DP problem:
The TRS P consists of the following rules:

P_IN_G(.(s(s(X)), .(Y, Xs))) → P_IN_G(.(X, .(Y, Xs)))
P_IN_G(.(0, Xs)) → P_IN_G(Xs)
P_IN_G(.(s(s(X)), .(Y, Xs))) → U1_G(X, Y, Xs, p_in_g(.(X, .(Y, Xs))))
U1_G(X, Y, Xs, p_out_g(.(X, .(Y, Xs)))) → P_IN_G(.(s(s(s(s(Y)))), Xs))

The TRS R consists of the following rules:

p_in_g(.(X, [])) → p_out_g(.(X, []))
p_in_g(.(s(s(X)), .(Y, Xs))) → U1_g(X, Y, Xs, p_in_g(.(X, .(Y, Xs))))
p_in_g(.(0, Xs)) → U3_g(Xs, p_in_g(Xs))
U3_g(Xs, p_out_g(Xs)) → p_out_g(.(0, Xs))
U1_g(X, Y, Xs, p_out_g(.(X, .(Y, Xs)))) → U2_g(X, Y, Xs, p_in_g(.(s(s(s(s(Y)))), Xs)))
U2_g(X, Y, Xs, p_out_g(.(s(s(s(s(Y)))), Xs))) → p_out_g(.(s(s(X)), .(Y, Xs)))

The set Q consists of the following terms:

p_in_g(x0)
U3_g(x0, x1)
U1_g(x0, x1, x2, x3)
U2_g(x0, x1, x2, x3)

We have to consider all (P,Q,R)-chains.